package com.fjwt.gz.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fjwt.gz.db.dto.FansUserDTO;
import com.fjwt.gz.db.entity.ActivityAppEntity;
import com.fjwt.gz.db.entity.ActivityEntity;
import com.fjwt.gz.db.vo.ActivityVO;
import com.fjwt.gz.service.mapper.ActivityAppMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * 活动配置应用表 服务实现类
 * </p>
 *
 * @author shiyonghao
 * @since 2025-04-09
 */
@Slf4j
@Service
public class ActivityAppService extends ServiceImpl<ActivityAppMapper, ActivityAppEntity> {

    @Autowired
    private ActivityAppMapper activityAppMapper;

    // 查询活动关联公众号用户信息
    public FansUserDTO getFansUerByActivityId(Long activityId, Long fansId) {
        return activityAppMapper.getFansUerByActivityId(activityId, fansId);

    }
    public IPage<ActivityEntity> selectActivityListByAppid(IPage page){
        return activityAppMapper.selectActivityListByAppid(page);
    }

    /**
     * 查询活动机构号
     * @param type
     * @param activityIds
     * @return
     */
    public List<ActivityVO> getActivityAgentNo(Integer type, Collection<Long> activityIds) {
        return activityAppMapper.getActivityAgentNo(type, activityIds);

    }

    /**外部查询活动信息**/
    public ActivityEntity getActivityToOutById(Long activityId,Long entryWay,String agentNoDb){
        return activityAppMapper.getActivityToOutById(activityId,entryWay,agentNoDb);
    }
}
